package net.ib.mtalk.ui.dialog;

import android.content.res.Resources;
import android.graphics.drawable.Drawable;

public class DialogListItem {
	public final String text;
	public final Drawable image;
	public final int actionTag;
	public final Drawable image2;
	
	public  DialogListItem(Resources res, String text, int imageResourceId , int imageResourceId2, int actionTag){
		this.text = text;
		if(imageResourceId != -1){
			image = res.getDrawable(imageResourceId);
		}else{
			image = null;
		}
		if(imageResourceId2 != -1){
			image2 = res.getDrawable(imageResourceId2);
		}else{
			image2 = null;
		}
		this.actionTag = actionTag;
	}

	public  DialogListItem(Resources res, int textResourceId, int imageResourceId, int actionTag){
		text = res.getString(textResourceId);
		if(imageResourceId != -1){
			image = res.getDrawable(imageResourceId);
		}else{
			image = null;
		}
		this.actionTag = actionTag;
		this.image2 = null;
	}
	
	public  DialogListItem(Resources res, String text, int actionTag){
		this.text = text;
		image = null;
		this.actionTag = actionTag;
		this.image2 = null;
	}
	@Override
	public boolean equals(Object o) {
		DialogListItem item = (DialogListItem) o;
		
		if(text.equals(item.text)) return true;
		return false;
	}
}
